Integrand size = 23, antiderivative size = 55 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {1}{2} (a-b) (a+3 b) x+\frac {(a-b)^2 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {b^2 \tan (c+d x)}{d} \]
Time = 1.09 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.00 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {2 \left (a^2+2 a b-3 b^2\right ) (c+d x)+(a-b)^2 \sin (2 (c+d x))+4 b^2 \tan (c+d x)}{4 d} \]
Time = 0.27 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.18, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3042, 4158, 300, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \tan (c+d x)^2\right )^2}{\sec (c+d x)^2}dx\) |
\(\Big \downarrow \) 4158 |
\(\displaystyle \frac {\int \frac {\left (b \tan ^2(c+d x)+a\right )^2}{\left (\tan ^2(c+d x)+1\right )^2}d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 300 |
\(\displaystyle \frac {\int \left (b^2+\frac {a^2-b^2+2 (a-b) b \tan ^2(c+d x)}{\left (\tan ^2(c+d x)+1\right )^2}\right )d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {1}{2} (a+3 b) (a-b) \arctan (\tan (c+d x))+\frac {(a-b)^2 \tan (c+d x)}{2 \left (\tan ^2(c+d x)+1\right )}+b^2 \tan (c+d x)}{d}\) |
(((a - b)*(a + 3*b)*ArcTan[Tan[c + d*x]])/2 + b^2*Tan[c + d*x] + ((a - b)^ 2*Tan[c + d*x])/(2*(1 + Tan[c + d*x]^2)))/d
3.5.47.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int [PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c , d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_ )])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim p[ff/(c^(m - 1)*f) Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)^n)^ p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && I ntegerQ[m/2] && (IntegersQ[n, p] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])
Leaf count of result is larger than twice the leaf count of optimal. \(110\) vs. \(2(51)=102\).
Time = 1.88 (sec) , antiderivative size = 111, normalized size of antiderivative = 2.02
method | result | size |
derivativedivides | \(\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{5}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+2 a b \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(111\) |
default | \(\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{5}}{\cos \left (d x +c \right )}+\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+2 a b \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(111\) |
risch | \(\frac {x \,a^{2}}{2}+x a b -\frac {3 x \,b^{2}}{2}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )} a^{2}}{8 d}+\frac {i {\mathrm e}^{2 i \left (d x +c \right )} a b}{4 d}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )} b^{2}}{8 d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} a^{2}}{8 d}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} a b}{4 d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} b^{2}}{8 d}+\frac {2 i b^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}\) | \(146\) |
1/d*(b^2*(sin(d*x+c)^5/cos(d*x+c)+(sin(d*x+c)^3+3/2*sin(d*x+c))*cos(d*x+c) -3/2*d*x-3/2*c)+2*a*b*(-1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)+a^2*(1/2* cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c))
Time = 0.27 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.25 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {{\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )} d x \cos \left (d x + c\right ) + {\left ({\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, b^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]
1/2*((a^2 + 2*a*b - 3*b^2)*d*x*cos(d*x + c) + ((a^2 - 2*a*b + b^2)*cos(d*x + c)^2 + 2*b^2)*sin(d*x + c))/(d*cos(d*x + c))
\[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\int \left (a + b \tan ^{2}{\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )}\, dx \]
Time = 0.30 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.20 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {2 \, b^{2} \tan \left (d x + c\right ) + {\left (a^{2} + 2 \, a b - 3 \, b^{2}\right )} {\left (d x + c\right )} + \frac {{\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \]
1/2*(2*b^2*tan(d*x + c) + (a^2 + 2*a*b - 3*b^2)*(d*x + c) + (a^2 - 2*a*b + b^2)*tan(d*x + c)/(tan(d*x + c)^2 + 1))/d
Leaf count of result is larger than twice the leaf count of optimal. 594 vs. \(2 (51) = 102\).
Time = 0.77 (sec) , antiderivative size = 594, normalized size of antiderivative = 10.80 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {a^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + 2 \, a b d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 3 \, b^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + a^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right ) + 2 \, a b d x \tan \left (d x\right )^{3} \tan \left (c\right ) - 3 \, b^{2} d x \tan \left (d x\right )^{3} \tan \left (c\right ) - a^{2} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, a b d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 3 \, b^{2} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + a^{2} d x \tan \left (d x\right ) \tan \left (c\right )^{3} + 2 \, a b d x \tan \left (d x\right ) \tan \left (c\right )^{3} - 3 \, b^{2} d x \tan \left (d x\right ) \tan \left (c\right )^{3} - a^{2} \tan \left (d x\right )^{3} \tan \left (c\right )^{2} + 2 \, a b \tan \left (d x\right )^{3} \tan \left (c\right )^{2} - 3 \, b^{2} \tan \left (d x\right )^{3} \tan \left (c\right )^{2} - a^{2} \tan \left (d x\right )^{2} \tan \left (c\right )^{3} + 2 \, a b \tan \left (d x\right )^{2} \tan \left (c\right )^{3} - 3 \, b^{2} \tan \left (d x\right )^{2} \tan \left (c\right )^{3} - a^{2} d x \tan \left (d x\right )^{2} - 2 \, a b d x \tan \left (d x\right )^{2} + 3 \, b^{2} d x \tan \left (d x\right )^{2} + a^{2} d x \tan \left (d x\right ) \tan \left (c\right ) + 2 \, a b d x \tan \left (d x\right ) \tan \left (c\right ) - 3 \, b^{2} d x \tan \left (d x\right ) \tan \left (c\right ) - a^{2} d x \tan \left (c\right )^{2} - 2 \, a b d x \tan \left (c\right )^{2} + 3 \, b^{2} d x \tan \left (c\right )^{2} - 2 \, b^{2} \tan \left (d x\right )^{3} + 2 \, a^{2} \tan \left (d x\right )^{2} \tan \left (c\right ) - 4 \, a b \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, a^{2} \tan \left (d x\right ) \tan \left (c\right )^{2} - 4 \, a b \tan \left (d x\right ) \tan \left (c\right )^{2} - 2 \, b^{2} \tan \left (c\right )^{3} - a^{2} d x - 2 \, a b d x + 3 \, b^{2} d x - a^{2} \tan \left (d x\right ) + 2 \, a b \tan \left (d x\right ) - 3 \, b^{2} \tan \left (d x\right ) - a^{2} \tan \left (c\right ) + 2 \, a b \tan \left (c\right ) - 3 \, b^{2} \tan \left (c\right )}{2 \, {\left (d \tan \left (d x\right )^{3} \tan \left (c\right )^{3} + d \tan \left (d x\right )^{3} \tan \left (c\right ) - d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + d \tan \left (d x\right ) \tan \left (c\right )^{3} - d \tan \left (d x\right )^{2} + d \tan \left (d x\right ) \tan \left (c\right ) - d \tan \left (c\right )^{2} - d\right )}} \]
1/2*(a^2*d*x*tan(d*x)^3*tan(c)^3 + 2*a*b*d*x*tan(d*x)^3*tan(c)^3 - 3*b^2*d *x*tan(d*x)^3*tan(c)^3 + a^2*d*x*tan(d*x)^3*tan(c) + 2*a*b*d*x*tan(d*x)^3* tan(c) - 3*b^2*d*x*tan(d*x)^3*tan(c) - a^2*d*x*tan(d*x)^2*tan(c)^2 - 2*a*b *d*x*tan(d*x)^2*tan(c)^2 + 3*b^2*d*x*tan(d*x)^2*tan(c)^2 + a^2*d*x*tan(d*x )*tan(c)^3 + 2*a*b*d*x*tan(d*x)*tan(c)^3 - 3*b^2*d*x*tan(d*x)*tan(c)^3 - a ^2*tan(d*x)^3*tan(c)^2 + 2*a*b*tan(d*x)^3*tan(c)^2 - 3*b^2*tan(d*x)^3*tan( c)^2 - a^2*tan(d*x)^2*tan(c)^3 + 2*a*b*tan(d*x)^2*tan(c)^3 - 3*b^2*tan(d*x )^2*tan(c)^3 - a^2*d*x*tan(d*x)^2 - 2*a*b*d*x*tan(d*x)^2 + 3*b^2*d*x*tan(d *x)^2 + a^2*d*x*tan(d*x)*tan(c) + 2*a*b*d*x*tan(d*x)*tan(c) - 3*b^2*d*x*ta n(d*x)*tan(c) - a^2*d*x*tan(c)^2 - 2*a*b*d*x*tan(c)^2 + 3*b^2*d*x*tan(c)^2 - 2*b^2*tan(d*x)^3 + 2*a^2*tan(d*x)^2*tan(c) - 4*a*b*tan(d*x)^2*tan(c) + 2*a^2*tan(d*x)*tan(c)^2 - 4*a*b*tan(d*x)*tan(c)^2 - 2*b^2*tan(c)^3 - a^2*d *x - 2*a*b*d*x + 3*b^2*d*x - a^2*tan(d*x) + 2*a*b*tan(d*x) - 3*b^2*tan(d*x ) - a^2*tan(c) + 2*a*b*tan(c) - 3*b^2*tan(c))/(d*tan(d*x)^3*tan(c)^3 + d*t an(d*x)^3*tan(c) - d*tan(d*x)^2*tan(c)^2 + d*tan(d*x)*tan(c)^3 - d*tan(d*x )^2 + d*tan(d*x)*tan(c) - d*tan(c)^2 - d)
Time = 12.29 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.65 \[ \int \cos ^2(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {\sin \left (2\,c+2\,d\,x\right )\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{2\,d}+\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (a-b\right )\,\left (a+3\,b\right )}{2\,\left (\frac {a^2}{2}+a\,b-\frac {3\,b^2}{2}\right )}\right )\,\left (a-b\right )\,\left (a+3\,b\right )}{2\,d} \]